Booking deletion fixed some minor problems remain
[RRRRHHHH_Code] / ruralHouses client / src / gui / DeleteOfferGUI.java
index 0ed19e8..7c1903d 100644 (file)
@@ -5,6 +5,7 @@ import java.awt.event.ActionListener;
 import java.awt.event.ItemEvent;
 import java.awt.event.ItemListener;
 import java.rmi.Naming;
+import java.rmi.RemoteException;
 import java.util.Vector;
 
 import javax.swing.JButton;
@@ -15,8 +16,8 @@ import javax.swing.JPanel;
 import javax.swing.JRadioButton;
 import javax.swing.border.EmptyBorder;
 
+import common.HouseInterface;
 import common.OfferInterface;
-
 import configuration.___IntNames;
 import domain.Offer;
 import domain.Owner;
@@ -29,23 +30,35 @@ public class DeleteOfferGUI extends JFrame {
         */
        private static final long serialVersionUID = 1L;
        private JPanel contentPane;
-       private Owner owner;
        private JLabel feedback;
        private JComboBox<RuralHouse> comboBox;
        private JComboBox<Offer> comboBox_1;
        private JButton btnDelete;
+       private Vector<RuralHouse> Hlist = null;
+       private HouseInterface hm = null;
 
        /**
         * Create the frame.
         */
        public DeleteOfferGUI(Owner o) {
-               this.owner = o;
+               try {
+                       hm = (HouseInterface) Naming
+                                       .lookup(___IntNames.HouseManager);
+               } catch (Exception e1) {
+                       System.out.println("Error accessing remote authentication: "
+                                       + e1.toString());
+               }
+               try {
+                       Hlist = hm.getHouses(o, null, null, 0, 0, 0, 0, 0);
+               } catch (RemoteException e1) {
+                       e1.printStackTrace();
+               }       
                setBounds(100, 100, 450, 300);
                contentPane = new JPanel();
                contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
                setContentPane(contentPane);
 
-               comboBox = new JComboBox<RuralHouse>(this.owner.getRuralHouses());
+               comboBox = new JComboBox<RuralHouse>(this.Hlist);
                comboBox.setBounds(101, 38, 314, 20);
 
                comboBox_1 = new JComboBox<Offer>();